import request from "../request";
import type { Response } from "../types";
const uploadImg: Response<
  { formdata: FormData; onUploadProgress: (e: any) => void },
  {
    url: string;
    name: string;
  }
> = params => {
  return request({
    url: "/common/uploadimg",
    method: "post",
    data: params.formdata,
    onUploadProgress: params.onUploadProgress
  });
};

const queryPublicKey: Response<null, Record<"publicKey", string>> = () =>
  request({
    method: "GET",
    url: "/common/publicKey"
  });
export { uploadImg, queryPublicKey };
